import { CharacterState, AirState } from "shared/enums/CharacterState"
import { SkillEnum } from "shared/enums/SkillEnum"
/**
 * 测试技能
 */
let frameLength = 15
const skill: Ctn.skill.SkillConfig = {
    id: SkillEnum.dodge,
    anim: "dodge",
    moveType: 'A',
    stopFrame: frameLength,
    characterState: {
        setAirStates: CharacterState.none,
        life: {
            duration: frameLength / 30,
            autoTransfrom: [
                {
                    airStates: AirState.Air,
                    targetStates: CharacterState.FreeFalling,
                }
            ]
        }
    },
    states: [
        {
            trigger: (input) => {
                return input.currentFrame === 0
            },
            turnCtrl: true,
            veloSet: {
                enable: true,
                // vector: new Vector3(0, 0, -50)
                line: -25
            },
            noCollision: true,
            cancelEnable: {
                [SkillEnum.swordS1]: {
                    enable: true
                }
            }
        },

        {
            trigger: (input) => (input.currentFrame === 10),
            veloSet: {
                enable: false,
            },
            noCollision: false,
            animChage: 'idle'
        },
        {
            trigger: (input) => (input.currentFrame === frameLength),
            stoped: true
        },
        // {
        //     trigger: (input) => {
        //         return input.currentFrame === 0 && input.characterEntity?.humanStates?.airStates !== AirState.Ground
        //     },
        //     moveCtrl: true,
        //     turnCtrl: true,
        // }
    ]
}
export default skill